Optimal. Leaf size=291 \[ \frac {\sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) (2 c d-b e)^2 C\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{5/2}}-\frac {\sqrt {\pi } \sin \left (2 a-\frac {b^2}{2 c}\right ) (2 c d-b e)^2 S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{5/2}}-\frac {\sqrt {\pi } e^2 \sin \left (2 a-\frac {b^2}{2 c}\right ) C\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{3/2}}-\frac {\sqrt {\pi } e^2 \cos \left (2 a-\frac {b^2}{2 c}\right ) S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{3/2}}+\frac {e (2 c d-b e) \sin \left (2 a+2 b x+2 c x^2\right )}{16 c^2}+\frac {e (d+e x) \sin \left (2 a+2 b x+2 c x^2\right )}{8 c}+\frac {(d+e x)^3}{6 e} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.36, antiderivative size = 291, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 7, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3468, 3464, 3447, 3351, 3352, 3462, 3448} \[ \frac {\sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) (2 c d-b e)^2 \text {FresnelC}\left (\frac {b+2 c x}{\sqrt {\pi } \sqrt {c}}\right )}{16 c^{5/2}}-\frac {\sqrt {\pi } \sin \left (2 a-\frac {b^2}{2 c}\right ) (2 c d-b e)^2 S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{5/2}}-\frac {\sqrt {\pi } e^2 \sin \left (2 a-\frac {b^2}{2 c}\right ) \text {FresnelC}\left (\frac {b+2 c x}{\sqrt {\pi } \sqrt {c}}\right )}{16 c^{3/2}}-\frac {\sqrt {\pi } e^2 \cos \left (2 a-\frac {b^2}{2 c}\right ) S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{3/2}}+\frac {e (2 c d-b e) \sin \left (2 a+2 b x+2 c x^2\right )}{16 c^2}+\frac {e (d+e x) \sin \left (2 a+2 b x+2 c x^2\right )}{8 c}+\frac {(d+e x)^3}{6 e} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3351
Rule 3352
Rule 3447
Rule 3448
Rule 3462
Rule 3464
Rule 3468
Rubi steps
\begin {align*} \int (d+e x)^2 \cos ^2\left (a+b x+c x^2\right ) \, dx &=\int \left (\frac {1}{2} (d+e x)^2+\frac {1}{2} (d+e x)^2 \cos \left (2 a+2 b x+2 c x^2\right )\right ) \, dx\\ &=\frac {(d+e x)^3}{6 e}+\frac {1}{2} \int (d+e x)^2 \cos \left (2 a+2 b x+2 c x^2\right ) \, dx\\ &=\frac {(d+e x)^3}{6 e}+\frac {e (d+e x) \sin \left (2 a+2 b x+2 c x^2\right )}{8 c}-\frac {e^2 \int \sin \left (2 a+2 b x+2 c x^2\right ) \, dx}{8 c}+\frac {(2 c d-b e) \int (d+e x) \cos \left (2 a+2 b x+2 c x^2\right ) \, dx}{4 c}\\ &=\frac {(d+e x)^3}{6 e}+\frac {e (2 c d-b e) \sin \left (2 a+2 b x+2 c x^2\right )}{16 c^2}+\frac {e (d+e x) \sin \left (2 a+2 b x+2 c x^2\right )}{8 c}+\frac {(2 c d-b e)^2 \int \cos \left (2 a+2 b x+2 c x^2\right ) \, dx}{8 c^2}-\frac {\left (e^2 \cos \left (2 a-\frac {b^2}{2 c}\right )\right ) \int \sin \left (\frac {(2 b+4 c x)^2}{8 c}\right ) \, dx}{8 c}-\frac {\left (e^2 \sin \left (2 a-\frac {b^2}{2 c}\right )\right ) \int \cos \left (\frac {(2 b+4 c x)^2}{8 c}\right ) \, dx}{8 c}\\ &=\frac {(d+e x)^3}{6 e}-\frac {e^2 \sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{3/2}}-\frac {e^2 \sqrt {\pi } C\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a-\frac {b^2}{2 c}\right )}{16 c^{3/2}}+\frac {e (2 c d-b e) \sin \left (2 a+2 b x+2 c x^2\right )}{16 c^2}+\frac {e (d+e x) \sin \left (2 a+2 b x+2 c x^2\right )}{8 c}+\frac {\left ((2 c d-b e)^2 \cos \left (2 a-\frac {b^2}{2 c}\right )\right ) \int \cos \left (\frac {(2 b+4 c x)^2}{8 c}\right ) \, dx}{8 c^2}-\frac {\left ((2 c d-b e)^2 \sin \left (2 a-\frac {b^2}{2 c}\right )\right ) \int \sin \left (\frac {(2 b+4 c x)^2}{8 c}\right ) \, dx}{8 c^2}\\ &=\frac {(d+e x)^3}{6 e}+\frac {(2 c d-b e)^2 \sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) C\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{5/2}}-\frac {e^2 \sqrt {\pi } \cos \left (2 a-\frac {b^2}{2 c}\right ) S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right )}{16 c^{3/2}}-\frac {e^2 \sqrt {\pi } C\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a-\frac {b^2}{2 c}\right )}{16 c^{3/2}}-\frac {(2 c d-b e)^2 \sqrt {\pi } S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \sin \left (2 a-\frac {b^2}{2 c}\right )}{16 c^{5/2}}+\frac {e (2 c d-b e) \sin \left (2 a+2 b x+2 c x^2\right )}{16 c^2}+\frac {e (d+e x) \sin \left (2 a+2 b x+2 c x^2\right )}{8 c}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.16, size = 215, normalized size = 0.74 \[ \frac {3 \sqrt {\pi } C\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \left (\cos \left (2 a-\frac {b^2}{2 c}\right ) (b e-2 c d)^2-c e^2 \sin \left (2 a-\frac {b^2}{2 c}\right )\right )-3 \sqrt {\pi } S\left (\frac {b+2 c x}{\sqrt {c} \sqrt {\pi }}\right ) \left (\sin \left (2 a-\frac {b^2}{2 c}\right ) (b e-2 c d)^2+c e^2 \cos \left (2 a-\frac {b^2}{2 c}\right )\right )+\sqrt {c} \left (3 e \sin (2 (a+x (b+c x))) (-b e+4 c d+2 c e x)+8 c^2 x \left (3 d^2+3 d e x+e^2 x^2\right )\right )}{48 c^{5/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.05, size = 257, normalized size = 0.88 \[ \frac {8 \, c^{3} e^{2} x^{3} + 24 \, c^{3} d e x^{2} + 24 \, c^{3} d^{2} x + 6 \, {\left (2 \, c^{2} e^{2} x + 4 \, c^{2} d e - b c e^{2}\right )} \cos \left (c x^{2} + b x + a\right ) \sin \left (c x^{2} + b x + a\right ) - 3 \, {\left (\pi c e^{2} \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) - \pi {\left (4 \, c^{2} d^{2} - 4 \, b c d e + b^{2} e^{2}\right )} \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {C}\left (\frac {{\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{c}\right ) - 3 \, {\left (\pi c e^{2} \cos \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right ) + \pi {\left (4 \, c^{2} d^{2} - 4 \, b c d e + b^{2} e^{2}\right )} \sin \left (-\frac {b^{2} - 4 \, a c}{2 \, c}\right )\right )} \sqrt {\frac {c}{\pi }} \operatorname {S}\left (\frac {{\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{c}\right )}{48 \, c^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [C] time = 0.77, size = 536, normalized size = 1.84 \[ \frac {1}{6} \, x^{3} e^{2} + \frac {1}{2} \, d x^{2} e + \frac {1}{2} \, d^{2} x - \frac {\sqrt {\pi } d^{2} \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {i \, b^{2} - 4 i \, a c}{2 \, c}\right )}}{8 \, \sqrt {c} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}} - \frac {\sqrt {\pi } d^{2} \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {-i \, b^{2} + 4 i \, a c}{2 \, c}\right )}}{8 \, \sqrt {c} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}} + \frac {\frac {\sqrt {\pi } b d \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {i \, b^{2} - 4 i \, a c - 2 \, c}{2 \, c}\right )}}{\sqrt {c} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}} - i \, d e^{\left (2 i \, c x^{2} + 2 i \, b x + 2 i \, a + 1\right )}}{8 \, c} + \frac {\frac {\sqrt {\pi } b d \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {-i \, b^{2} + 4 i \, a c - 2 \, c}{2 \, c}\right )}}{\sqrt {c} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}} + i \, d e^{\left (-2 i \, c x^{2} - 2 i \, b x - 2 i \, a + 1\right )}}{8 \, c} - \frac {{\left (c {\left (2 i \, x + \frac {i \, b}{c}\right )} - 2 i \, b\right )} e^{\left (2 i \, c x^{2} + 2 i \, b x + 2 i \, a + 2\right )} + \frac {\sqrt {\pi } {\left (b^{2} + i \, c\right )} \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {i \, b^{2} - 4 i \, a c - 4 \, c}{2 \, c}\right )}}{\sqrt {c} {\left (-\frac {i \, c}{{\left | c \right |}} + 1\right )}}}{32 \, c^{2}} - \frac {{\left (c {\left (-2 i \, x - \frac {i \, b}{c}\right )} + 2 i \, b\right )} e^{\left (-2 i \, c x^{2} - 2 i \, b x - 2 i \, a + 2\right )} + \frac {\sqrt {\pi } {\left (b^{2} - i \, c\right )} \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x + \frac {b}{c}\right )} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}\right ) e^{\left (-\frac {-i \, b^{2} + 4 i \, a c - 4 \, c}{2 \, c}\right )}}{\sqrt {c} {\left (\frac {i \, c}{{\left | c \right |}} + 1\right )}}}{32 \, c^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.05, size = 378, normalized size = 1.30 \[ \frac {e^{2} x \sin \left (2 c \,x^{2}+2 b x +2 a \right )}{8 c}-\frac {e^{2} b \left (\frac {\sin \left (2 c \,x^{2}+2 b x +2 a \right )}{4 c}-\frac {b \sqrt {\pi }\, \left (\cos \left (\frac {-4 c a +b^{2}}{2 c}\right ) \FresnelC \left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )+\sin \left (\frac {-4 c a +b^{2}}{2 c}\right ) \mathrm {S}\left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )\right )}{4 c^{\frac {3}{2}}}\right )}{4 c}-\frac {e^{2} \sqrt {\pi }\, \left (\cos \left (\frac {-4 c a +b^{2}}{2 c}\right ) \mathrm {S}\left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )-\sin \left (\frac {-4 c a +b^{2}}{2 c}\right ) \FresnelC \left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )\right )}{16 c^{\frac {3}{2}}}+\frac {d e \sin \left (2 c \,x^{2}+2 b x +2 a \right )}{4 c}-\frac {d e b \sqrt {\pi }\, \left (\cos \left (\frac {-4 c a +b^{2}}{2 c}\right ) \FresnelC \left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )+\sin \left (\frac {-4 c a +b^{2}}{2 c}\right ) \mathrm {S}\left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )\right )}{4 c^{\frac {3}{2}}}+\frac {\sqrt {\pi }\, d^{2} \left (\cos \left (\frac {-4 c a +b^{2}}{2 c}\right ) \FresnelC \left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )+\sin \left (\frac {-4 c a +b^{2}}{2 c}\right ) \mathrm {S}\left (\frac {2 c x +b}{\sqrt {c}\, \sqrt {\pi }}\right )\right )}{4 \sqrt {c}}+\frac {x^{2} d e}{2}+\frac {d^{2} x}{2}+\frac {x^{3} e^{2}}{6} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 7.83, size = 2344, normalized size = 8.05 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\cos \left (c\,x^2+b\,x+a\right )}^2\,{\left (d+e\,x\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (d + e x\right )^{2} \cos ^{2}{\left (a + b x + c x^{2} \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________